part of 'view.dart';

Future<void> _showTypePicker(VoidCallback callback) async {
  final types = _types.value;
  if (types.isEmpty) {
    AppToast.showWarning('暂无数据');
    return;
  }
  final selector = CustomTreePicker(
    initial: _selectedType.value,
    treeData: types,
    accentColor: const Color(0xff1847E3),
  );
  final val = await Get.bottomSheet<TreeChoiceIface>(
    Container(
      height: 470.w,
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(13.w),
      ),
      child: selector,
    ),
  );
  if (val != null) {
    _selectedType.value = val as KnowledgeBaseTypeTreeEntity;
    callback();
  }
}
